#pragma once

#include <jsoncpp/json/json.h>

namespace WordMemory
{
    struct DailyLearningStat
    {
        std::string date;
        int forgot_count = 0;
        int vague_count = 0;
        int known_count = 0;

        Json::Value to_json() const
        {
            Json::Value stat_json;
            stat_json["date"] = date;
            stat_json["forgot"] = forgot_count;
            stat_json["vague"] = vague_count;
            stat_json["known"] = known_count;
            return stat_json;
        }

        void from_json(const Json::Value& json)
        {
            date = json["date"].asString();
            forgot_count = json["forgot"].asInt();
            vague_count = json["vague"].asInt();
            known_count = json["known"].asInt();
        }
    };
}